package com.example.controller;

import lombok.extern.slf4j.Slf4j;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;

/**
 * @ClassName JsoupContorller
 * @Description TODO
 * @Author zhaoluowei
 * @Date 2019/9/3  22:49
 * @Version 1.0
 */
@RestController
@RequestMapping(value = "/jsoup")
@Slf4j
public class JsoupContorller {


    @RequestMapping(value = "/testJsoup")
    public void testJsoup() throws IOException {

//        Document document = Jsoup.parse(new URL("https://maoyan.com/board"), 100000);
//        log.info(" 解析 --> "+document);

        //https://maoyan.com/films/1211270
        Document document = Jsoup.parse(new URL("https://maoyan.com/films/1211270"), 100000);
        log.info(" 解析 --> "+document);
    }


}
